package edu.sctu.fengleilin.month06.day150610.GameRandom;

import java.util.Arrays;
import java.util.Random;

/**
* Created by user09 on 2015/6/10.
*/
public class GameMain {
//    public static void main(String[] args) {
//GameWay gameWay = new GameWay();
//        gameWay.setGameData();
//
//    }
public static void main(String[] arg) {
    int n = (int) (Math.random() * 9000) + 1000;
    System.out.println(n);
    int[] nn = new int[4];
    int i = 4;
    while (i-- > 0) {
        nn[i] = n % 10;
        n /= 10;
    }

    Arrays.sort(nn);
    int k = 0;
    for (i = 1; i < 4; i++) {
        if (nn[i] == nn[i - 1]) {
            k++;
        }else if(k>0){
            break;
        }
    }

    if (k == 0) {
        System.out.println("没中奖");
    } else {
        System.out.println((4 - k) + " 等奖");
    }
}
}
